/**
 * 订单管理 交易订单
 */
<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>审核者——个人信息</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 搜索筛选 -->
   
    <!--列表-->
    <div class="good">
    <el-row :gutter="20" style="margin-top:10px;" >
        <el-col :span="8">
            <div class="grid-content bg-purple">
                 <el-card class="box-card" style="height:500px" >
        <div slot="header" class="clearfix">
          <span>个人中心</span> 
        </div>
          <div class="name-role">
          <span class="sender">用户信息: {{listData.id}} </span>  
        </div>
        <br>
        <div class="registe-info">
          <span class="registe-info">
            注册时间：{{listData.createDate}}
        
          </span>
        </div>
        <el-divider></el-divider>
        <div class="personal-relation" > 
        <div class="relation-item">用户名:  <div style="float: right; padding-right:20px;">{{listData.userName}}</div></div> 
        </div><br>
        <div class="personal-relation">
        <div class="relation-item">手机号:  <div style="float: right; padding-right:20px;">{{listData.phone}}</div></div> 
        </div><br>
        <div class="personal-relation">
        <div class="relation-item">邮箱:  <div style="float: right; padding-right:20px;">{{listData.email}}</div></div> 
    </div><br>
    <div class="personal-relation">
      <div class="relation-item">姓名:  <div style="float: right; padding-right:20px;">{{listData.realName}}</div></div> 
    </div><br>
       <!-- <div class="personal-relation">
      <div class="relation-item">性别:  <div style="float: right; padding-right:20px;">{{listData.sex}}</div></div>      
    </div><br> -->
    <el-button class="good1" type="primary"  @click="dk()">修改信息</el-button>
      </el-card>
        </div>
        </el-col>
  

      </el-row>
</div>
    <!-- 分页组件 -->
   
    <!-- 添加 -->
    <el-dialog title="捐赠" :visible.sync="editFormVisible" width="50%" >
      <el-form label-width="120px" :model="newlist" ref="editForm">
        <el-row>
          <el-col :span="12">
            <el-form-item label="手机号">
              <el-input size="small" v-model="newlist.phone" ></el-input>
            </el-form-item>
            <el-form-item label="用户名">
              <el-input size="small" v-model="newlist.userName"  ></el-input>
            </el-form-item>
            <el-form-item label="密码">
              <el-input size="small" v-model="newlist.password"  ></el-input>
            </el-form-item>
            <!-- <el-form-item label="身份证号">
              <el-input size="small" v-model="newlist.idCard"  ></el-input>
            </el-form-item> -->
            <el-form-item label="姓名">
              <el-input size="small" v-model="newlist.realName"  ></el-input>
            </el-form-item>
            <el-form-item label="邮箱">
              <el-input size="small" v-model="newlist.email"  ></el-input>
          </el-form-item>
          </el-col>
        </el-row>
      </el-form>
        <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="closeDialog()">取消</el-button>
        <el-button size="small" type="primary" :loading="loading" class="title"   @click="go()">确认</el-button>
      </div>
    </el-dialog>

    
  </div>
</template>

<script>
import axios from 'axios';
import store from '../../vuex/store'
export default {
  data() {
    return {  
      newlist:{},
     
    dataForm:{
        nickName: '超级管理员',
        phone: '173567777777',
        homeUrl: 'http://www.baidu.com'
      },

      
      loading: false, //是显示加载
      editFormVisible1: false, //控制编辑页面显示与隐藏

      editFormVisible: false, //控制编辑页面显示与隐藏
        
      // 删除部门
    
      userparm: [], //搜索权限
      listData: [], //用户数据
      // 分页参数
    
    }
  },
  // 注册组件
  components: {
    store
  },
  /**
   * 数据发生改变
   */

  /**
   * 创建完毕
   */
  mounted(){
       


  },
  created() {
    
      // this.listData   = this.$route.query.data
      //  this.listData.userName   = localStorage.getItem("userName")
      //  this.listData.phone   = localStorage.getItem("phone")
      //  this.listData.email   = localStorage.getItem("email")
      //  this.listData.realName   = localStorage.getItem("realName")
      //  this.listData.sex   = localStorage.getItem("sex")
      //  this.listData.createDate   = localStorage.getItem("createDate")
       this.listData.id   = localStorage.getItem("id")
      //  this.listData.password   = localStorage.getItem("password")
      //  this.listData.idCard   = localStorage.getItem("idCard")
      //  this.listData.idCard   = localStorage.getItem("account")
      //  this.listData.idCard   = localStorage.getItem("address")
      //  this.listData.idCard   = localStorage.getItem("difficultyType")
       this.getdata()
       console.log("ths3333",this.listData);
  },

  /**
   * 里面的方法只有被调用才会执行
   */
  methods: {
     dk(){
   this.editFormVisible = true
      this.newlist = this.listData
     },
    go(){
       
      axios.post("http://47.106.193.50:8080/admin/updateAdmin",this.listData).then((response) => {
            console.log(response);
            if (response.data.code == "200") {
              this.editFormVisible = false;
              this.getdata();
              this.$notify({
                title: "成功",
                message: "edit Successfully",
                type: "success",
                duration: 2000,
              });
            } else {
              this.$notify({
                title: "失败",
                message: "edit failly",
                type: "warning",
                duration: 2000,
              });
            }
            this.getdata()
          });
    },
    // 获取公司列表
   getdata() {
      this.loading = false
      axios.get("http://47.106.193.50:8080/admin/adminById?id="+this.listData.id).then(res => {
        
            let data = res.data.data
            this.listData = data
            // 分页赋值
            // this.pageparm.currentPage = this.formInline.page
            // this.pageparm.pageSize = this.formInline.limit
            // this.pageparm.total = res.count
        })
    },
    // 分页插件事件
   
    // 搜索事件
  
    //显示编辑界面
   
  

    //修改更新
 
    

   
  
    // 删除

    
    // 关闭编辑、增加弹出框
       closeDialog() {
      this.editFormVisible = false
  
    },
  
  }
}
</script>

<style scoped >

.user-search {
  margin-top: 20px;
}
.userRole {
  width: 100%;
}

.good{
  /* display: flex; */
  /* justify-content: center; */
  /* align-content: center; */
  height: 80%;
  width: 1400px;
  margin-left: 30%;
}
.good1{
  margin-left: 36%;
  margin-top: 6%;
}
</style>